<%@page import="java.util.List,
                org.massdeception.content.entities.Slide,
                org.massdeception.content.entities.MOTD,
                org.massdeception.content.util.SlideUtils"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" dir="ltr" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Mass Deception</title>

<link rel="stylesheet" href="css/styles.css" type="text/css" media="screen" />

</head>
<body>

<a href="authorUploadSlide.jsp">Add new Slide</a><br>
<a href="authorClearCache">Clear Cache</a><br><br>

Or edit existing slide (slides with publish date close to today):<br>
<form method="post" action="<%=request.getContextPath()%>/authorEditSlide">
<select name="slideId" size="10">
<%
  List<Slide> slides = (List<Slide>) request.getAttribute("slides");

  for ( Slide slide : slides )
  {
%>
    <option value="<%=slide.getId()%>"><%=slide.getTitle()%> (<%=SlideUtils.getUIDate(slide.getPublishDate())%>)</option>
<%
  }
%>
</select><br><br>
<input type="submit" value="Edit">
</form>

<form method="post" action="<%=request.getContextPath()%>/authorEditMOTD">
<br>Edit MOTD:<br>

<%
  MOTD motd = (MOTD) request.getAttribute("motd");
%>
<textarea cols="50" rows="6" name="motd"><%=motd.getMessage()%></textarea><br>

<input type="submit" value="Update" />

</form>

</body>
</html>